package com.tiankong.product.controller;


import com.tiankong.product.dto.SpuInfoDto;
import com.tiankong.product.service.SpuInfoService;
import net.youdi.common.filter.PageFilter;
import net.youdi.common.model.Page;
import net.youdi.common.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * spu信息 前端控制器
 * </p>
 *
 * @author scl
 * @since 2021-03-22
 */
@RestController
@RequestMapping("/spuinfo")
public class SpuInfoController {

    @Autowired
    private SpuInfoService spuInfoService;
    /**
     * 列表
     */
    @RequestMapping("page/list")
    public Result list(PageFilter filter){
        Page page = spuInfoService.queryPage(filter);
        return Result.ok().setPage(page);
    }
    /**
     * 保存
     */
    @RequestMapping("/save")
    public Result save(@RequestBody SpuInfoDto spuInfoDto){
        spuInfoService.saveSpuInfo(spuInfoDto);

        return Result.ok();
    }


}
